package com.zx.job.service.Impl;

import Job.Dto.CategoryDto;
import com.zx.job.mapper.CategoryMapper;
import com.zx.job.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class CategoryServiceImpl implements CategoryService {

    private final CategoryMapper categoryMapper;

    @Override
    public List<CategoryDto> findAll() {
        return categoryMapper.findALl();
    }

    @Override
    public void addCategory(CategoryDto categoryDto) {
        categoryMapper.addCategory(categoryDto);
    }

    @Override
    public void deleteCategory(Integer id) {
        categoryMapper.deleteCategory(id);
    }

    @Override
    public void updateCategory(CategoryDto categoryDto) {
        categoryMapper.updateCategory(categoryDto);
    }

    @Override
    public List<CategoryDto> findByName(String name) {
        return categoryMapper.findByName(name);
    }


}
